package io.cloud.tec.ant_design_vue_pro.web;

import io.cloud.tec.ant_design_vue_pro.dto.ActivityDTO;
import io.cloud.tec.project.util.JsonUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("api/workplace")
public class WorkplaceWeb {

    @GetMapping("activity")
    List<ActivityDTO> activity() {
        String json = "[{\"id\":1,\"user\":{\"nickname\":\"@name\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png\"},\"project\":{\"name\":\"白鹭酱油开发组\",\"action\":\"更新\",\"event\":\"番组计划\"},\"time\":\"\"},{\"id\":1,\"user\":{\"nickname\":\"蓝莓酱\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png\"},\"project\":{\"name\":\"白鹭酱油开发组\",\"action\":\"更新\",\"event\":\"番组计划\"},\"time\":\"\"},{\"id\":1,\"user\":{\"nickname\":\"@name\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png\"},\"project\":{\"name\":\"白鹭酱油开发组\",\"action\":\"创建\",\"event\":\"番组计划\"},\"time\":\"\"},{\"id\":1,\"user\":{\"nickname\":\"曲丽丽\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png\"},\"project\":{\"name\":\"高逼格设计天团\",\"action\":\"更新\",\"event\":\"六月迭代\"},\"time\":\"\"},{\"id\":1,\"user\":{\"nickname\":\"@name\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/jZUIxmJycoymBprLOUbT.png\"},\"project\":{\"name\":\"高逼格设计天团\",\"action\":\"created\",\"event\":\"六月迭代\"},\"time\":\"\"},{\"id\":1,\"user\":{\"nickname\":\"曲丽丽\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png\"},\"project\":{\"name\":\"高逼格设计天团\",\"action\":\"created\",\"event\":\"六月迭代\"},\"time\":\"\"}]";
        return JsonUtils.parseList(json, ActivityDTO.class);
    }

    @GetMapping("teams")
    List<TeamDTO> teams() {
        String json = "[{\"id\":1,\"name\":\"科学搬砖组\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png\"},{\"id\":2,\"name\":\"程序员日常\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/cnrhVkzwxjPwAaCfPbdc.png\"},{\"id\":1,\"name\":\"设计天团\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/gaOngJwsRYRaVAuXXcmB.png\"},{\"id\":1,\"name\":\"中二少女团\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/ubnKSIfAJTxIgXOKlciN.png\"},{\"id\":1,\"name\":\"骗你学计算机\",\"avatar\":\"https://gw.alipayobjects.com/zos/rmsportal/WhxKECPNujWoWEFNdnJE.png\"}]";
        return JsonUtils.parseList(json, TeamDTO.class);
    }

    @GetMapping("radar")
    List<Map> radar() {
        String json = "[{\"item\":\"引用\",\"个人\":70,\"团队\":30,\"部门\":40},{\"item\":\"口碑\",\"个人\":60,\"团队\":70,\"部门\":40},{\"item\":\"产量\",\"个人\":50,\"团队\":60,\"部门\":40},{\"item\":\"贡献\",\"个人\":40,\"团队\":50,\"部门\":40},{\"item\":\"热度\",\"个人\":60,\"团队\":70,\"部门\":40},{\"item\":\"引用\",\"个人\":70,\"团队\":50,\"部门\":40}]";
        return JsonUtils.parseList(json, Map.class);
    }
}
